package cn.dreamblog.controller;

import cn.dreamblog.pojo.BlogType;
import cn.dreamblog.service.BlogTypeService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 项目名：dreamblog
 * 创建人：君忆zm
 * 创建时间：2019/11/11-10:17
 */
@Controller
@RequestMapping("/blogtype")
public class BlogTypeController {
    @Resource
    BlogTypeService blogTypeService;

    @RequestMapping("/queryblogtype.do")
    @ResponseBody
    public String query(HttpSession session){
        List<BlogType> blogTypeList = blogTypeService.queryBlogType();
        return JSON.toJSONString(blogTypeList);
    }
}
